package net.cyndeline.rldungeon.dgs.objects

/**
 * Extended by items that trigger off of an activator, such as locks.
 *
 * @param activators All activators that trigger this responder.
 */
abstract class Responder(activators: Activator*) {
  private val active = activators.toSet

  /**
   * @return a list of every activator this responder responds to.
   */
  def allActivators: List[Activator] = activators.toList

  /**
   * Checks if this responder responds to an activator.
   * @param activator Activator to check response to.
   * @return True if this responder responds to the activator, otherwise false.
   */
  def respondsTo(activator: Activator): Boolean = active.contains(activator)

}
